package com.lqk.shardingjdbcproj.entity.response;

import lombok.Data;
import lombok.ToString;

@Data
@ToString
public class ReturnReponse<T> {
    private Integer code;
    private String message;
    private T data;

    public ReturnReponse() {
        super();
    }

    public ReturnReponse(Integer code, String message) {
        super();
        this.code = code;
        this.message = message;
    }

    public ReturnReponse(Integer code, String message, T data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public ReturnReponse(Integer code, T data) {
        this.code = code;
        this.data = data;
    }
    public static ReturnReponse success(int code, String message){
        return new ReturnReponse(code,message);
    }
    // 方法重载
    public static ReturnReponse success(int code, String message,Object data){
        return new ReturnReponse(code,message,data);
    }
    public static ReturnReponse fail(int code, String message){
        return new ReturnReponse(code,message);
    }
    public static ReturnReponse fail(int code, String message, Object data){
        return new ReturnReponse(code,message,data);
    }
}
